package com.meeting.manager.tools;


import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

public class T {
	public static void show(Context context, String msg) {
		if (context != null) {
			Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
		}
	}

	public static void openQQ(Context context, String qq) {
		String url = "mqqwpa://im/chat?chat_type=wpa&uin=" + qq;
		try {
			Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
			intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(intent);
		} catch (Exception e) {
			Toast.makeText(context, "请安装QQ", Toast.LENGTH_SHORT).show();
		}
	}

	public static void dialPhone(Context context, String phone) {
		try {
			Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"
					+ phone));
			intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(intent);
		} catch (Exception e) {
			Toast.makeText(context, "电话服务不可用", Toast.LENGTH_SHORT).show();
		}

	}

}
